<?php
/* SVN FILE: $Id: rate.ctp 34 2009-10-17 13:42:12Z kenreily@gmail.com $ */
/**
 * Short description for file.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * Recenseo: Online submission and reviewing for education
 * Copyright 2008-2009, Ken Reily
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * $Date: 2009-10-17 13:42:12 +0000 (Sat, 17 Oct 2009) $
 * $Revision: 34 $
 * $Author: kenreily@gmail.com $
 * $HeadURL: http://recenseo.googlecode.com/svn/trunk/app/views/assessments/rate.ctp $
 */
  if (!empty($this->data)) 
  {
?>
<h2>Please read this assessment and submit your rating below.</h2>
<p>
<dl>
  <dt>Assignment</dt>
  <dd><?= $this->data['Assignment']['name'] ?></dd>

  <dt>Grading Option</dt>
  <dd><?= $this->data['GradingOption']['name'] ?></dd>

<?php
    if (!empty($this->data['Submission']['comments']))
    {
?>
  <dt>Comments</dt>
  <dd><?= $this->data['Submission']['comments'] ?>&nbsp;</dd>
<?php
    }
?>
</dl>
</p>
<h4>Test Cases</h4>
<table width="100%">
<?php
  echo $html->tableHeaders(array('#','Name','Description','Results','Outcome'));
    
  if (count($test_cases) > 0)
  {
    foreach ($test_cases as $test_case)
    {
      echo $html->tableCells(array($test_case['t']['id'],
                                   $test_case['t']['name'],
                                   $test_case['t']['description'],
                                   $test_case['at']['results'],
                                   $test_case['r']['name']),
                             null,
                             array('class' => 'altrow'));
    }        
  }
  else
  {
?>
<tr><td colspan="6">No Test Cases Found.</td></tr>
<?php
  }
?>
</table>
<p><?=count($test_cases)?> Completed Test Cases</p>
<br>
<h4>Submission Qualities</h4>
<table>
<?php
    echo $html->tableHeaders(array('Quality','Response','Comments'));

    foreach ($qualities as $quality)
    {      
      $comments = $quality['aq']['comments'];
      
      if (empty($comments))
      {
        $comments = '(None)';
      }
             
      echo $html->tableCells(array($quality['q']['name'],$quality['l']['name'],$comments),null,array('class' => 'altrow'));
    }
?>
</table>
<?php
    echo $form->create('Assessment',array('action' => 'rate'));
    echo $form->input('id');
    echo $form->input('Submission.id',array('type' => 'hidden'));
    echo $form->input('author_rating',array('type' => 'radio',
                                            'label' => 'Please rate this assessment on the following scale:',
                                            'options' => array(5 => '5 - Exceptional',
 					                       4 => 4,
							       3 => '3 - Good',
							       2 => 2,
							       1 => '1 - Cursory; course staff should review this assessment')));
    echo $form->input('author_comments');
    echo $form->end('Submit');
  }
?>
